
import User from "./User"
import { PaginationTable } from "@xuekl/cli-core/builder"
import { Selection, Index, TableIndex } from '@xuekl/cli-core/helper'
import { TableSelection, TableOperation, TableColumn } from "@xuekl/cli-core/types"

export default class UserTable extends PaginationTable<User> implements Selection<User>, Index {
    index: TableIndex = {
        width: 60,
        label: '序号'
    }

    selection: TableSelection = {}

    selectedData: User[] = []

    operation: TableOperation = {
        label: '操作',
        width: 140,
        fixed: 'right'
    }


    columns: TableColumn<User>[] = [
        {
            prop: 'nickName',
            label: '用户昵称',
            element: {
                sortable: 'custom',
                width: 200
            }
        },
        {
            prop: 'userName',
            label: '用户名称',
            element: {
                sortable: true,
                width: 200
            }
        },
        {
            prop: 'deptId',
            label: '部门'
        },
        {
            prop: 'phonenumber',
            label: '手机号',
        },
        {
            prop: 'status',
            label: '状态',
        },
        {
            prop: 'sex',
            label: '性别',
            dict: 'sys_user_sex'
        },
        {
            prop: 'createTime',
            label: '创建时间',
            format: 'YYYY-MM-DD HH:mm:ss'
        }
    ]
}